<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>自定义指令</title>
  <script src="../vue.js"></script>
  <style>
    [v-cloak] {
      display: none;
    }
  </style>
</head>
<body>
  <div id="root" v-cloak>
    <div v-pre>{{title}}</div>
    <input v-abc type="text">
    <div v-gp22:red.50="style">hello</div>
  </div>
  <!-- <pre>
    拼搏到无能为力
        坚持到感动自己
  </pre> -->
  <script type="module">
    Vue.config.productionTip = false

    import './v-focus.js'

    var vm = new Vue({
      el: '#root',
      data: {
        messsage: 'hello',
        style: 'italic'
      },
      mounted() {
        // this.$refs['ipt'].focus()
      },
      directives: {
        gp22(el, bindings) {
          // console.log(el)
          console.log(bindings)
          let { arg, modifiers, value } = bindings
          let m = Object.keys(modifiers)
          el.style['color'] = arg
          el.style['font-size'] = m[0] + 'px'
          el.style['font-style'] = value
        }
      }
    })
  </script>
</body>
</html>